package com.christ.society.service.user.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.christ.society.bean.page.PageView;
import com.christ.society.bean.user.UserInfo;
import com.christ.society.dao.user.UserInfoDao;
import com.christ.society.service.user.UserInfoService;
import com.christ.society.service.utils.ParamUtil;

@Service("userInfoService")
public class UserInfoServiceImpl implements UserInfoService{
    @Autowired
	private UserInfoDao userInfoDao;
	public int saveUserInfo(UserInfo vo) {
		return userInfoDao.insertUserInfo(vo);
	}
	public PageView<UserInfo> queryUserInfoPage(UserInfo param, int page, int size) {
		PageView<UserInfo> pv = new PageView<UserInfo>(size, page);
		 Map<String, Object> hashParam = ParamUtil.hashParam(param, page,size);
		 System.out.println(hashParam);
		 pv.setRecords( userInfoDao.selectUserInfoPage(hashParam));
		  pv.setTotalRecord(userInfoDao.selectCountUserInfo(hashParam));
		return pv;
	}

}
